/********************************************************/
/*	GLUT class by George Chew					*/
/*	For use in GeorgeLib								*/
/*	Created Mar 2013									*/
/*														*/
/*	Version 0001										*/
/********************************************************/

#ifndef __GLUT_H__
#define __GLUT_H__


#include "stdafx.h"
#include "Logger.h"
#include "LuaScript.h"

#define GLUT GeorgeLib::_GLUT::getInstance()

namespace GeorgeLib
{

class DLLEXPORT _GLUT
{

	/*		How to use this class 		*/
	// GLUT->InitWindow(&argc, argv, "GeorgeFramework", 50, 50, 800, 600);
	// GLUT->InitWindowFromFile(&argc, argv, "GL_Init.txt");

private:
	static	_GLUT*	GLUT_Instance;// Singleton Instance
	enum { IDLE = 0, DISPLAY, KEYBOARD_DOWN, KEYBOARD_UP, SPECIAL_DOWN, SPECIAL_UP, RESHAPE, MOUSE, MOTION, PASSIVE_MOTION };
	
public:
	_GLUT(void);			// Constructor
	~_GLUT(void);			// Destructor

	// Get the singleton instance of this class 
	static	_GLUT*	getInstance			(void);

	// Create an OpenGL window
	// pargc		: main function's unmodified argc
	// argv			: main function's unmodified argv
	// title		: title of the OpenGL window
	// displayMode	: initial display mode, eg. (GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA)
	// x			: x-position of window in pixels
	// y			: y-position of window in pixels
	// width		: width of window in pixels
	// height		: height of window in pixels
			void	InitWindow			(	int * pargc, char ** argv, 
														const char * title, 
														GLuint displayMode = -1, 
														int x = -1, int y = -1, 
														int width = -1, int height = -1	);

	// Create an OpenGL window with parameters from a file
	// pargc		: main function's unmodified argc
	// argv			: main function's unmodified argv
	// filename		: file containing parameters for the initialisation of the window
	// 
	// Your file should have the following variables defined:
	// title		: title of your window in quotes,				eg. title = "GeorgeLib GLUT Test"
	// displayMode	: the different modes you need in quotes,		eg. displayMode = "GLUT_DEPTH, GLUT_DOUBLE, GLUT_RGBA"
	// x			: the x-position of your window in pixels,		eg. x = 100
	// y			: the y-position of your window in pixels,		eg. y = 100
	// width		: the width of your window,						eg.	width = 800
	// height		: the height of your window,					eg.	height = 800
			bool	InitWindowFromFile	(int * pargc, char ** argv, char * filename);
};

} // namespace GeorgeLib

#endif // __GLUT_H__ //